<?php $base_path = Yii::app()->baseUrl; ?>
<div class="block">

    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        <h2>Danh sách quyền</h2>
        <ul>            
            <li><a href="<?php echo $this->createUrl('role/add') ?>">Add type</a></li>
        </ul>
    </div>
    <div class="block_content">
        <?php echo showMessage(); ?>
        <form action="" method="post">
            <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th>Name</th>
                        <th>Total User</th>                        
                        <td>&nbsp;</td>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    if (!empty($data['roles'])) {
                        $i = 1;
                        foreach ($data['roles'] as $item) {
                            ?>
                            <tr>
                                <td><?php echo $i++; ?></td>
                                <td><?php echo $item->role ?></td>
                                <td><?php echo $item->total_user; ?></td>                                
                                <td class="delete">
                                    <a href="<?php echo $this->createUrl('role/permission', array('id' => $item->id)) ?>">Permission</a> || 
                                    <a href="<?php echo $this->createUrl('role/edit', array('id' => $item->id)) ?>">Edit</a> || 
                                    <a href="<?php echo $this->createUrl('role/delete', array('id' => $item->id)) ?>" onclick="return confirm('Bạn chắc chắc chắn muốn xóa quyền đã chọn');">Delete</a>
                                </td>
                            </tr>
                            <?php
                        }
                    } else {
                        ?>
                        <tr><td colspan="4">No data</td></tr>
                        <?php
                    }
                    ?>                    
                </tbody>
            </table>                 
        </form>

    </div>
    <div class="bendl"></div>
    <div class="bendr"></div>
</div>